﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Matriculex.Dominio;
using Matriculex.UI.Helpers;

namespace Matriculex.UI.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            if (TempData["debug"] != null)
                return View();
            if (ControllerContext.CurrentUser() == null)
                return RedirectToAction("Login", "Login");

            else if (ControllerContext.CurrentUser() is Aluno)
                return RedirectToAction("Index", "Rematricula");

            else if (ControllerContext.CurrentUser() is Gerente)
                return RedirectToAction("Index", "Cadastro");

            return View();

        }

        public ActionResult Contato()
        {
            return View();
        }
    }
}
